//
//  MyContactListener.m
//  TestCocosWithBox2
//
//  Created by Nguyen Tan Loc on 8/14/13.
//  Copyright (c) 2013 Nguyen Tan Loc. All rights reserved.
//

#import "MyContactListener.h"
#import "MainGameScene.h"

MyContactListener::MyContactListener()
{
}

MyContactListener::~MyContactListener()
{
}

void MyContactListener::BeginContact(b2Contact* contact)
{
    MyContact myContact = { contact->GetFixtureA(), contact->GetFixtureB() };
    
    if ([MainGameScene getInstance] != nil)
        [[MainGameScene getInstance] handleCollision:myContact.fixtureA fixtureB:myContact.fixtureB];
}

void MyContactListener::EndContact(b2Contact* contact)
{
    MyContact myContact = { contact->GetFixtureA(), contact->GetFixtureB() };
    
    if ([MainGameScene getInstance] != nil)
        [[MainGameScene getInstance] handleCollision:myContact.fixtureA fixtureB:myContact.fixtureB];
}

void MyContactListener::PreSolve(b2Contact* contact, const b2Manifold* oldManifold) {
}

void MyContactListener::PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) {
}

